﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ITAP.Core.Modelling.Primitives;

namespace ITAP.ShprossesBuilder.Modelling.Components
{
    public static class EndedComponentExtensionMethods
    {
        public static EndType IsConnectedToEnd(this IEndedComponent endedComponent, IComponent component)
        {
            if (endedComponent.StartConnectedComponent == component && endedComponent.EndConnectedComponent == component)
                return EndType.Both;
            else if (endedComponent.StartConnectedComponent == component)
                return EndType.Start;
            else if (endedComponent.EndConnectedComponent == component)
                return EndType.End;
            else
                return EndType.NotDefined;
        }
     
    }
}
